<%@ include file="/WEB-INF/views/taglib.jsp" %>
<h3>Location Form</h3>	
	<form:form id="form" method="post" modelAttribute="location"  cssClass="simpleForm">
		<form:hidden path="locationId" />
		<form:hidden path="active" />
		
	 	<div class="clear" style="height:1px">&nbsp;</div>
		<jsp:include page="/WEB-INF/views/message.jsp"></jsp:include>
	  	<fieldset>
	  		<legend>Location Info</legend>
	  		<p>
	  		<aims:column cssErrorClass="error" path="locationCode" >
	  		<form:label path="locationCode">
	  			Location Code  * 
	 		</form:label>
	  		<form:input path="locationCode" id="locationCode" /> <form:errors path="locationCode"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="locationName" >
	  		<form:label path="locationName">
	  			Location Name * 
	 		</form:label>
	  		<form:input path="locationName" size="50" /> <form:errors path="locationName"  cssClass="errorSimple" />	 
			</aims:column>
			<aims:column cssErrorClass="error" path="section" >
	  		<form:label path="section">
	  			Section *
	 		</form:label>
	 		<form:select path="section.sectionId">
	 			<form:option value=""></form:option>
	 			<form:options items="${globalSection}" itemValue="sectionId" itemLabel="sectionName" />
	 		</form:select>
	  		 <form:errors path="section"  cssClass="errorSimple" />	 
			</aims:column>
			</fieldset>
      <div class="action">
	  	<c:choose>
	  		<c:when test="${location.locationId==null}">
	  			<button type="submit" class="button positive">
	  			Save
	  			</button>
	  			<a href="<c:url value="/location/search" />" class="button">Back</a>
	  		</c:when>
	  		<c:when test="${location.locationId!=null}">
  				<button type="submit"  class="button positive">
  				Update</button>
  				<a href="<c:url value="/location/search" />" class="button">Back</a>
	  		</c:when>
	  	</c:choose>
	 </div>	
	</form:form>
	<script type="text/javascript">
		$(document).ready(function() {
			<c:if test="${location.locationId!=null }">
				//readonlyAttr('#locationCode');
			</c:if>	
		});
	</script>